<?php  if(!defined('DEDEINC')) exit('dedecms');
/**
 * 扩展小助手
 *
 * @version        $Id: extend.helper.php 1 13:58 2010年7月5日Z tianya $
 * @package        DedeCMS.Helpers
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */

/**
 *  返回图集图片
 *
 * @param     string  $n  字符ID
 * @return    string
 */
if ( ! function_exists('mulitimgs'))
{
    function mulitimgs($id)
    {
         global $dsql;
	     $sql = "select mulitimgs from `dede_archives` where id ='$id'";
	     $chRow = $dsql->GetOne($sql);
		 $obj = $chRow['mulitimgs'];
		 $match = $id;
		 preg_match_all("/ddimg=\'(.*?)\'/",$obj,$match); 
		 preg_match_all("/text=\'(.*?)\'/",$obj,$text); 
         $str="";
		 $zong   = (count($match[1]));
		 $t_zong = (count($text[1]));



		 for($i=1;$i<=count($match[1]);$i++)
		 { 
			    $str.= "<img src='".$match[1][$i-1]."' width='100' height='75' />".$text[1][$i-1]."";  
		 } 
		 return $str;
    }
}


